<?php
require('config.php');

        $user_id=$_REQUEST['user_id'];
		$sql="select * from `".$oto."_users` where `userId`='{$user_id}' LIMIT 1";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$user_info[]=$row;//将取得的所有数据赋值给person_info数组
		}
		$sql="select * from `".$oto."_agentset` where `status`='1' LIMIT 1";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$agent_info[]=$row;//将取得的所有数据赋值给person_info数组
		}
		$sql="select * from `".$oto."_agent_apply` where `userId`='{$user_id}' order by `time` DESC";
		$result=$db->query($sql);
		while($row=$result->fetch_assoc()){
			$agent_apply_info[]=$row;//将取得的所有数据赋值给person_info数组
		}
		$agent_info[0]['ktx_yj']=$user_info[0]['agentBalance'];
		$agent_info[0]['dq_time']=time();
		if(!isset($agent_apply_info))
		{
			$agent_info[0]['cj_time']=0;
		}
		else
		{
			$agent_info[0]['cj_time']=$agent_apply_info[0]['time'];
		}
		echo json_encode($agent_info);
?>